import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    username:window.localStorage.getItem('user'||'[]'==null?'':JSON.parse(window.localStorage.getItem('username'||'')))
  },
  mutations: {
    login(state,username){
      state.username=username
      window.localStorage.setItem("username",JSON.stringify(username))
    }
  },
  actions: {
  },
  modules: {
  }
})
